/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - core/math/types/Fpu
// Copyright (c) 2014.  All Rights Reserved
//
// File:		AEFpuMathTypes.h
// Author:		Gianluca Belardelli
// Date:		11/01/2014
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEFPUMATHTYPES_H_
#define _AEFPUMATHTYPES_H_

struct AEQuadFloat32
{
	AE_ALIGN16 AEFLOAT32 quadFloat[4];
};

struct AEQuadDouble64
{
	AE_ALIGN32 AEDOUBLE64 quadDouble[4];
};

typedef AEFLOAT32 AESingleFloat32;
typedef AEDOUBLE64 AESingleDouble64;

// storage type for hkVector4Comparison
typedef AEINT32 AEVector4fMask;

class AEVector4f;
typedef const AEVector4f &AEVector4fRefParam;

class AESimdFloat32;
typedef const AESimdFloat32 &AESimdFloat32ConstRef;

class AEVector4fComparison;
typedef const AEVector4fComparison &AEVector4fConstRefCompParam;

#define AE_TRANSPOSEf_SWAP(a,b) __tmp = a; a = b; b = __tmp

// transpose 3 AEVector4f: w component is undefined
#define AE_VECTORTRANSPOSE3F(v0,v1,v2) { AEFLOAT32 __tmp; \
	AE_TRANSPOSEf_SWAP( v0(1), v1(0) ); \
	AE_TRANSPOSEf_SWAP( v0(2), v2(0) ); \
	AE_TRANSPOSEf_SWAP( v1(2), v2(1) ); }

#define AE_VECTORTRANSPOSE3F(v0,v1,v2,v3) { AEFLOAT32 __tmp; \
	AE_TRANSPOSEf_SWAP( v0(1), v1(0) ); \
	AE_TRANSPOSEf_SWAP( v0(2), v2(0) ); \
	AE_TRANSPOSEf_SWAP( v0(3), v3(0) ); \
	AE_TRANSPOSEf_SWAP( v1(2), v2(1) ); \
	AE_TRANSPOSEf_SWAP( v1(3), v3(1) ); \
	AE_TRANSPOSEf_SWAP( v2(3), v3(2) ); }

#endif // _AEFPUMATHTYPES_H_